/**
 * @file:          Filter_BinarySecondOrder.h
 * @brief:         
 * @details:       
 * @author:        wjh
 * @date created:  2023.07.28
 * @version:       1.0.0
 * @par copyright (c):
 *   
 * @par history (desc):
 *   version:1.0.0, wjh, 2023.07.28,16:51:20
 */


#ifndef _FILTER_BINARYSECONDORDER_H_
#define _FILTER_BINARYSECONDORDER_H_

/* Include Files **************************************************************/
#include "Datatype.h"

/* Macro Definition ***********************************************************/

/* Data Type Define ***********************************************************/
typedef struct Filter_BinarySecondOrder
{
    /* public data */
    uint16 param_en;
    float32 param_Ts;
    float32 param_fc;
    float32 param_depth;
    float32 param_zeta_0N;
    float32 param_zeta_0D;
    
    float32 m[3];
    float32 n[2];
    
    float32 x_last1;
    float32 x_last2;
    float32 y_last1;
    float32 y_last2;
    float32 in_x;
    float32 out_y;

    /* private data */
    
    /* public method */
    void (*Init)(struct Filter_BinarySecondOrder *self);
    float32 (*Run)(struct Filter_BinarySecondOrder *self, float32 in);
    void (*Clear)(struct Filter_BinarySecondOrder *self);
    void (*UpdateParam)(struct Filter_BinarySecondOrder *self);

    /* private method */
    
}Filter_BinarySecondOrder;

/* Variable Declare ***********************************************************/

/* Function Declare ***********************************************************/

void Filter_BinarySecondOrder_Init(struct Filter_BinarySecondOrder *self);
float32 Filter_BinarySecondOrder_Run(struct Filter_BinarySecondOrder *self, float32 in);
void Filter_BinarySecondOrder_Clear(struct Filter_BinarySecondOrder *self);
void Filter_BinarySecondOrder_UpdateParam(struct Filter_BinarySecondOrder *self);
#endif